//
//  U9ClearMemory.m
//  U9WatchGame
//
//  Created by uuu9 on 2017/8/10.
//  Copyright © 2017年 UUU9. All rights reserved.
//

#import "U9ClearMemory.h"

@implementation U9ClearMemory

+ (void)clearCache{
    NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSError *errors;
    NSFileManager *defauleManager = [NSFileManager defaultManager];
    NSArray *fileList = [defauleManager contentsOfDirectoryAtPath:libraryPath error:nil];
    for (id file in fileList) {
        [defauleManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@",libraryPath,file] error:&errors];
    }
}

@end
